<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/template/common/header.jsp"%>
<div class="pageHeader" style="border: 1px #B8D0D6 solid">
	<form onsubmit="return divSearch(this,'index-list-box');"
		action="${base }/recommend!list.action" method="post" rel="pagerForm">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>标题<input type="text" name="recommend.title"
						value="${recommend.title }" alt="请输入标题 " size="30" /></td>
					<td><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div></td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="${base }/recommend!add.action"
				target="dialog" rel="recommend_add" mask="true"><span>添加推荐</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="260" rel="index-list-box">
		<thead>
			<tr>
				<th width="80">标题</th>
				<th width="20">链接</th>
				<th width="20">标价</th>
				<th width="20">卖价</th>
				<th width="20">序号</th>
				<th width="20">来源</th>
				<th width="40">创建时间</th>
				<th width="20">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${recommends }" var="recommend">
				<tr target="recommend" rel="${ recommend.id}">
					<td>${recommend.title }</td>
					<td><a href="${recommend.url }" target="_blank"> <c:choose>
								<c:when test="${fn:length(recommend.url) > 50}">
									<c:out value="${fn:substring(recommend.url , 0, 50)}......" />
								</c:when>
								<c:otherwise>
									<c:out value="${recommend.url }" />
								</c:otherwise>
							</c:choose>
					</a></td>
					<td>$${recommend.listPrice }</td>
					<td>$${recommend.price }</td>
					<td>${recommend.orders }</td>
					<td><c:choose>
							<c:when test="${recommend.source=='AWS' }">amazon</c:when>
							<c:when test="${recommend.source=='EBAY' }">eBay</c:when>
							<c:otherwise>
							amazon
							</c:otherwise>
						</c:choose></td>
					<td><fmt:formatDate value="${recommend.createDate }"
							pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<td><a class="btnEdit"
						href="${base }/recommend!edit.action?recommend.id=${recommend.id}"
						target="dialog" rel="adver_edit" mask="true"><span>编辑</span></a><a
						class="btnDel"
						href="${base }/recommend!delete.action?recommend.id=${recommend.id}"
						target="ajaxTodo" title="确定删除-${recommend.title }"
						rel="adver_delete"><span>删除</span></a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
<cy:pagination pageBean="${pager }"
	pageUrl="${base }/recommend!list.action">
	<%@include file="/WEB-INF/template/common/pagination.jsp"%>
</cy:pagination>